#include "io430.h"

void delay(unsigned long value)
{
	do
        {
          value--;
        }
        while(value != 0);
}

void main( void )
{
  // Stop watchdog timer to prevent time out reset
  WDTCTL = WDTPW + WDTHOLD;
  P1DIR_bit.P0 = 1;
  P1DIR_bit.P6 = 1;
  P1DIR_bit.P3 = 0;
  
  P1OUT_bit.P0 = 1;
  P1OUT_bit.P6 = 0;
  delay(20000);
  while(1)
  {
    P1OUT_bit.P0 = !P1OUT_bit.P0;
    P1OUT_bit.P6 = !P1OUT_bit.P6;
    if(P1IN_bit.P3 == 0)
    {
      delay(10000);
    }
    else
    {
      delay(32768);
    }
  }
}

